﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Threading;

using YouDown.Views;

namespace YouDown
{
    public partial class App : Application
    {
        private static Mutex m;

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            m = new Mutex(false, "Global\\{BBFD465B-F743-4b34-AE4A-5A2EB0AF2BE7}");
#if !DEBUG
            if (!m.WaitOne(TimeSpan.Zero, false))
            {
                MessageBox.Show("Another instance of YouDown is already running");
                App.Current.Shutdown();
            }
#endif
        }
    }
}